//
//  UrlManager.m
//  EnvironmentalProtection
//
//  Created by HCreater on 2018/7/6.
//  Copyright © 2018年 HCreater. All rights reserved.
//

#import "UrlManager.h"

@implementation UrlManager

MHSingletonM(UrlManager);

- (void)setConfigData:(NSDictionary *)configData
{
    _configData = configData;
    
    NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
    [userDefaults setObject:_configData[@"MainUrl"] forKey:@"MainUrl"];
    [userDefaults synchronize];
}

- (NSString*)mainUrl
{
    NSString* strDefault = @"http://hbapi.huan-ju.cn/api/";
    
    if (_configData && [_configData.allKeys containsObject:@"MainUrl"])
    {
        strDefault = _configData[@"MainUrl"];
    }
    
    return strDefault;
}

@end
